﻿@model MvcSiteMapProvider.Web.Html.Models.MenuHelperModel
@using System.Web.Mvc.Html
@using MvcSiteMapProvider.Web.Html.Models

<ul class="menu">
    @foreach (var node in Model.Nodes)
    {
        if (@node.Controller == "Alumnos" && @Request.Cookies["workspace"] == null)
        {
            continue;
        }
        else if (@node.Controller == "Term" && @Request.Cookies["workspace"] == null)
        {
            continue;
        }
        else if (@node.Controller == "Home" && @node.Action == "Index")
        {
            <li class="parent"><span>@Html.DisplayFor(m => node)</span> 
                @if (node.Children.Any())
                {
                    <ul>
                        @foreach (var nodito in node.Children)
	                    {
		                   <li> <span> @Html.DisplayFor(m => nodito)</span></li>
                        }
                    </ul>
                   
                }
            </li>
        }
        else if (@node.Controller == "Home" && @node.Action == "About")
        {
            <li class="last"><span>@Html.DisplayFor(m => node)</span> 
                @if (node.Children.Any())
                {
                   <ul>
                        @foreach (var nodito in node.Children)
                        {
		                   <li> <span> @Html.DisplayFor(m => nodito)</span></li>
                        }
                    </ul>
                }
            </li>
        }
        else
        {
            <li><span>@Html.DisplayFor(m => node)</span> 
                @if (node.Children.Any())
                {
                   <ul>
                        @foreach (var nodito in node.Children)
                        {
		                   <li> <span> @Html.DisplayFor(m => nodito)</span></li>
                        }
                    </ul>
                }
            </li>
        }

    }
</ul>